package com.example.adv_android;

import android.content.Context;
import android.content.SharedPreferences;

//SharedPreferences存储
public class Store {
    public static final String PricesKey="key.Prices";//价格汇总


    private static SharedPreferences sp = MyApp.getInstance().getSharedPreferences("advStore", Context.MODE_PRIVATE);

    //默认String类型输入
    public static void put(String key, String value) {
        sp.edit().putString(key, value).apply();
    }


    //默认String型value输出
    public static String get(String key) {
        return sp.getString(key, "");
    }




    //清空数据
    public static void clear(){
        sp.edit().clear().commit();
    }
}
